<?
//引入所有子系统信息
include_once("../../../common/model/extender_import.php");



//获取板块的设置
include_once("model/setting.php");


//获取员工信息
$employee=select_one_line_all_items($table_Prefix."employee","nid = '".$_REQUEST['nid']."' ");


if(!file_exists(ROOT_PATH_."/uploadfiles/".$_unit[$_SESSION['unit']]['uploadfile']."/employee/"))
{
    mkdir(ROOT_PATH_."/uploadfiles/".$_unit[$_SESSION['unit']]['uploadfile']."/employee",0777,true);
    chmod(ROOT_PATH_."/uploadfiles/".$_unit[$_SESSION['unit']]['uploadfile']."/employee",0777);
}



//判断一下员工绑定二维码是否存在，不存在就生成。
//员工二维码时  employee/{emloyeenid}.png
//为员工生成绑定二维码
if(!file_exists(ROOT_PATH_."/uploadfiles/". $_unit[$_SESSION['unit']]['uploadfile']."/employee/".$employee['nid'].".png"))
{
    //echo "不存在";
    $parma['url']  = "https://milkorder.dagger.enpingshi.com/api/binding_wechat_and_employee.php?p=".$employee['nid']."@".$_SESSION['unit'];
    $parma['name'] = $employee['nid'];
    $parma['local'] = ROOT_PATH_."/uploadfiles/". $_unit[$_SESSION['unit']]['uploadfile']."/employee/";

    $result=creat_qrcode($parma);
    //print_r2($result);

}
else
{
    $bind_code="";
}





?>








